$('.s').click(function(){
    // $('#mask').fadeOut(  )
    $('#mask').css({display:'none'})

});


const urlObj = myGetUrlVal();
console.log(urlObj)
setPage();


$('.tb').click(function(e){
    if ($(e.target).attr('name') === 'del' ){
        console.log( Number(e.target.getAttribute('id')) );

        $('.tb').splice(Number( e.target.getAttribute('index')),1 );
        setPage();
    }
})


async function setPage(){
    const response =  await myPromiseJQueryAjax('https://api.iynn.cn/mock?t=2','post',{ },'json');
    console.log(response);

const oTbody = document.querySelector( 'tbody');

let str = '';
response.data.forEach(item => {
    str +=`
    <tr>
                    <th>${item.id}</th>
                    <th>${item.title}</th>
                    <th>${item.user}</th>
                    <th>${item.date}</th>
                    <th name="del">删除</th>
                    <th name="editor">编辑</th>
                </tr>
    `;
});
oTbody.innerHTML =str 
};
